package test_PropertyChangeSupport_Class;
import java.beans.PropertyChangeListener;  
import java.beans.PropertyChangeSupport;  
  
public class BeanTest {  
    private boolean property;  
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(  
            this);  
  
    public void setProperty(boolean newValue) {  
        boolean oldValue = property;  
        property = newValue;  
        changeSupport.firePropertyChange("property", oldValue, newValue);  
    }  
  
    public void addPropertyChangeListener(PropertyChangeListener l) {  
        changeSupport.addPropertyChangeListener(l);  
    }  
  
    public void removePropertyChangeListener(PropertyChangeListener l) {  
        changeSupport.removePropertyChangeListener(l);  
    }  
}  